/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: DcmRte.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: Dcm
*
*******************************************************************************/

#ifndef DCMRTE_H
#define DCMRTE_H

/** HEADER FILES **/
#include "PduRType.h"
#include "PduRDcmCfg.h"
#include "DemType.h"


/** GLOBAL FUNCTION DECLARATION **/
extern Std_ReturnType PduR_DcmTransmit(
    PduIdType TxPduId,
    const PduInfoType* PduInfoPtr
);

extern Std_ReturnType AppDiag_Security_Level1_GetSeed(
    Dcm_OpStatusType OpStatus,
    uint8* Seed,
    Dcm_NegativeResponseCodeType* ErrorCode
);

extern Std_ReturnType AppDiag_Security_Level1_CompareKey(
    const uint8* Key,
    Dcm_OpStatusType OpStatus,
    Dcm_NegativeResponseCodeType* ErrorCode
);

extern Std_ReturnType AppDiag_DID_F190_VIN_Data_ReadData(
    uint8* Data
);


extern Std_ReturnType AppDiag_DID_F190_VIN_Data_WriteData(
    uint8* Data
);

/* Dem related interfaces */
extern Std_ReturnType Dem_SetDTCFilter(
    uint8 ClientId,
    uint8 DTCStatusMask,
    Dem_DTCFormatType DTCFormat,
    Dem_DTCOriginType DTCOrigin,
    boolean FilterWithSeverity,
    Dem_DTCSeverityType DTCSeverityMask,
    boolean FilterForFaultDetectionCounter
);

extern Std_ReturnType Dem_SelectDTC(
    uint8 ClientId,
    uint32 DTC,
    Dem_DTCFormatType DTCFormat,
    Dem_DTCOriginType DTCOrigin
);

extern Std_ReturnType Dem_GetStatusOfDTC(
    uint8 ClientId,
    uint8* DTCStatus
);

extern Std_ReturnType Dem_GetDTCStatusAvailabilityMask(
    uint8 ClientId,
    Dem_UdsStatusByteType* DTCStatusMask,
    Dem_DTCOriginType DTCOrigin
);

extern Std_ReturnType Dem_GetNumberOfFilteredDTC(
    uint8 ClientId,
    uint16* NumberOfFilteredDTC
);

extern Std_ReturnType Dem_GetNextFilteredDTC(
    uint8 ClientId,
    uint32* DTC,
    uint8* DTCStatus
);

extern Std_ReturnType Dem_GetNextExtendedDataRecord(
    uint8 ClientId,
    uint8* DestBuffer,
    uint16* BufSize
);

extern Std_ReturnType Dem_DisableDTCSetting (
    uint8 ClientId
);

extern Std_ReturnType Dem_EnableDTCSetting (
    uint8 ClientId
);


#endif
